<template>
    <Layout class="p-5 bg-white">
        <Form class="p-5" :model="tableInfo.store" :label-width="80">
			<Row>
				<Col span="14">
					<FormItem class="w-50" label="编号">
						<label>{{tableInfo.store.storeId}}</label>
					</FormItem>
					<FormItem class="w-100" label="店名">
						<label>{{tableInfo.store.name}}</label>
					</FormItem>
					<FormItem class="w-100" label="地址">
						<label>{{tableInfo.store.address}}</label>
						
					</FormItem>
					<FormItem class="w-100" label="描述">
						<label>{{tableInfo.store.des}}</label>
						<!-- <Input v-model="tableInfo.store.des" type="textarea" :rows="4" placeholder="请输入..."style="width: 790px"></Input> -->
					</FormItem>
					
				</Col>
				<Col span="8">
					<FormItem class="w-100" label="状态">
						 <span v-if="tableInfo.store.statu">启用</span>
						 <span v-else>禁用</span>
					</FormItem>
					<FormItem class="w-100" label="联系人">
						<label>{{tableInfo.store.conPerson}}</label>
						
					</FormItem>
					<FormItem class="w-100" label="联系电话">
						<label>{{tableInfo.store.conTel}}</label>
						
					</FormItem>
					<!-- <FormItem class="w-100" label="状态">
						 <span v-if="tableInfo.store.statu">启用</span>
						 <span v-else>禁用</span>
					</FormItem> -->
				</Col>
			</Row>			
			<Layout :class="'bg-white'">
				<Table border :class="'m-1'" :columns="tableInfo.columnInfo" :data="tableInfo.access">
					<template slot-scope="{ row, index }" slot="ioFlg">
						<span v-if="row.ioFlg">进门</span>
						<span v-else>出门</span>
					</template>
					<template slot-scope="{ row, index }" slot="statu">
						<span v-if="row.statu">启用</span>
						<span v-else>禁用</span>
					</template>
				</Table>
			</Layout>
			<Layout :class="'bg-white'">
				<Table border :class="'m-1'" :columns="tableInfo.columnInfo1" :data="tableInfo.wxServers">
					<template slot-scope="{ row, index }" slot="statu">
						<span v-if="row.statu">启用</span>
						<span v-else>禁用</span>
					</template>
				</Table>
			</Layout>
        </Form>
    </Layout>

</template>
<script>
	import store from "../../common/store.js"
	export default {
		data() {
			return {
				tableInfo: {
					storeId: 0,
					store:{
						storeId:"",
						name:"",
						address:"",
						conTel:"",
						conPerson:"",
						des:"",
						statu:"",
					},
					access:[],
					wxServers:[],												
					currentPage: 1,
					total: 0,
					columnInfo: [
						{
							title: "门禁编号",
							key: "accessId",
							width: 70
						},
						{
							title: "设备型号",
							key: "modelNumber",
							width: 150
						},
						{
							title: "设备ID",
							key: "uid",
							width: 150
						},
						{
							title: "授权Key",
							key: "ukey",
							width: 150
						},
						{
							title: "门禁序列号",
							key: "sn",
							width: 150
						},
						{
							title: "状态",
							slot: "statu",
							width: 150
						},
						{
							title: "进/出门",
							slot: "ioFlg",
							// width: 100
						},
						
					],
					columnInfo1: [
						{
							title: "编号",
							key: "wid",
							width: 70
						},
						{
							title: "公众号类型",
							key: "wxType",
							width: 110
						},
						{
							title: "APPID",
							key: "appId",
							width: 200
						},
						// {
						// 	title: "密钥",
						// 	key: "accessKey",
						// 	width: 110
						// },
						{
							title: "商户号",
							key: "merchantId",
							width: 200
						},
						// {
						// 	title: "商户证书序列号",
						// 	key: "merchantSerialNo",
						// 	width: 150
						// },
						// {
						// 	title: "私钥字符串",
						// 	key: "merchantPrivateKeyStr",
						// 	width: 150
						// },
						// {
						// 	title: "V3秘钥",
						// 	key: "apiV3Key",
						// 	width: 150
						// },
						{
							title: "地址",
							key: "payUrl",
							width: 200
						},
						{
							title: "状态",
							slot: "statu",
							// width: 150
						},
						
					]
				}
			}
		},
		methods: {
			show: function(storeId) {
				this.$router.push({
					name: "wxServer_new",
					params: {
						storeId
					}
				});
			},
			init: function () {
			    this.search();
			},
			search: function () {
			    this.http.get({
			        url: "/store/cha",
					param: {
					    storeId : this.current.store.storeId
					}
			    }).then(data => {
                    this.$data.tableInfo.store = data.store[0];
					this.$data.tableInfo.access = data.access;
					this.$data.tableInfo.storeAccess = data.storeAccess;
					this.$data.tableInfo.wxServers = data.wx_server;
                });
			}
		},
		mounted: function () {
			this.init();
		},
		computed: {
			current: function() {
				return store.state.currentUser;
			}
		}
	}
</script>

<style>
</style>

